{% extends "base.html" %}
{% block head %}
    {{ super() }}
    <style type="text/css">

    </style>

    {#    <script src='https://www.google.com/recaptcha/api.js' async defer></script>#}
    <link rel="stylesheet"
          href="{{ url_for("static",filename = "3rd/bootstrap-notify-master/css/bootstrap-notify.css") }}">
    <link rel="stylesheet"
          href="{{ url_for("static",filename = "3rd/bootstrap-notify-master/css/styles/alert-blackgloss.css") }}">
{% endblock %}

{% block maindiv %}
    <div class="pubexams row box-body">
    {% for exam in res.exam %}
        <div class="col-lg-3 col-xs-6">
        <!-- small box -->
        {% if exam.flag ==1 %}
            <div class="small-box box box-widget bg-green">
        {% elif exam.flag ==2 %}
            <div class="small-box box box-widget bg-blue">
        {% elif exam.flag ==3 %}
            <div class="small-box box box-widget bg-orange">
        {% else %}
             <div class="small-box box box-widget bg-red">
        {% endif %}
    {#                <div class="small-box box box-widget bg-green">#}
    <input name="classid" type="hidden" value="{{ exam.exam.exam_id }}"/>
    {#                <div class="box-tools pull-right">#}
    {#                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i#}
    {#                            class="fa fa-times"></i></button>#}
    {#                </div>#}
    <div class="inner">
        <h3>{{ exam.exam.title }}</h3>

        <p>{{ exam.exam.des_crib }}</p>
        <p>测试时间: {{ exam.exam.start_time.strftime('%Y-%m-%d %H:%M') }}
            ~ {{ exam.exam.end_time.strftime('%Y-%m-%d %H:%M') }}</p>
    </div>
    {% if exam.flag ==2 %}
        <a href="{{ url_for('web.startexam', eid=exam.exam.exam_id) }}" class="small-box-footer">
            开始考试 <i class="fa fa-arrow-circle-right"></i>
        </a>
    {% elif exam.flag ==1 %}
        <a href="" style="pointer-events:none" class="small-box-footer">
            考试尚未开始 <i class="fa fa-arrow-circle-right"></i>
        </a>
    {% elif exam.flag ==3 %}
        <a href="" style="pointer-events:none" class="small-box-footer">
            考试已经结束 <i class="fa fa-arrow-circle-right"></i>
        </a>
    {% else %}
        <a href="" style="pointer-events:none" class="small-box-footer">
            您已参加过这次考试 <i class="fa fa-arrow-circle-right"></i>
        </a>
    {% endif %}
    </div>
    </div>
    {% endfor %}
</div>
{% endblock %}
{% block scripts %}
    {{ super() }}

    <script src="{{ url_for("static",filename="3rd/bootstrap-notify-master/js/bootstrap-notify.js") }}"></script>
    <script>
        $('#btn-login').css('display', 'none');
        $('#user_info span').css('display', 'block');
        $('#user_info span').text('你好呀,' + {{ res.data.nickname }});
        $('#user_info .user_info_panel div').text('ID:' +{{ res.data.id}});
        $('.user_info_panel').css('display', 'block');
        $('.user_avatar').on('mouseover', function () {
            $('.user_avatar_cover').css('display', 'block');
        }).css('cursor', 'pointer')
        $('.user_avatar').on('mouseout', function () {
            $('.user_avatar_cover').css('display', 'none');
        });

        $('.user_avatar').css('pointer-events', 'auto');
        $('.guest-page').css('display', 'none');
        $('.user-page').css('display', 'block');
        $('.avatar-img').attr('src', "{{ res.data.avatar_url}}");


    </script>


{% endblock %}